Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

NURB Patches

Figure 15 shows a NURB patch.

Figure 15 A NURB patch

Labels

ASCII
NURBPatch
Binary
nrbp ( = 0x6E726270 )

Data Format

Uns32                               uOrder
Uns32                               vOrder
Uns32                               numMPoints
Uns32                               numNPoints
RationalPoint4D                     points[numMPoints * numNPoints]
Float32                             uKnots[uOrder + numMPoints]
Float32                             vKnots[vOrder + numNPoints]
uOrder
The order of a NURB patch in the u parametric direction. For NURB patches defined by ratios of B-spline polynomials that are cubic in u , the order is 4. In general, the order of a NURB patch defined by polynomial equations in which u is of degree n is n +1.
vOrder
The order of a NURB patch in the v parametric direction. For NURB patches defined by ratios of B-spline polynomials that are cubic in v , the order is 4. In general, the order of a NURB patch defined by polynomial equations in which v is of degree n is n +1.
numMPoints
The number of control points in the u parametric direction. The value of this field must be greater than 1.
numNPoints
The number of control points in the v parametric direction. The value of this field must be greater than 1.
points[]
An array of rational four-dimensional control points that define the NURB patch. The size of this array is as indicated in the data format.
uKnots[]
An array of knots in the u parametric direction that define the NURB patch. The values in this array must be nondecreasing, but successive values may be equal. The size of this array is as indicated in the data format.
vKnots[]
An array of knots in the v parametric direction that define the NURB patch. The values in this array must be nondecreasing, but successive values may be equal. The size of this array is as indicated in the data format.

Data Size

16 + (16 * numMPoints * numNPoints) + (uOrder + numNPoints + vOrder + numMPoints) * 4

Description

A NURB patch is a three-dimensional surface defined by ratios of B-spline surfaces, which are three-dimensional analogs of B-spline curves.

Default Surface Parameterization

The default surface parameterization of a NURB patch is as shown in Figure 15 .

Parent Hierarchy

Shared, shape, geometry.

Parent Objects

None.

Child Objects

Trim curves (optional). A trim curves object is a collection of two-dimensional NURB curves that are used to trim a NURB surface. See "Trim Loops" , and "2D NURB Curves" , for descriptions of these objects.

Example

NURBPatch (
    4                                                       #uOrder
    4                                                       #vOrder
    4                                                       #numMPoints
    4                                                       #numNPoints

    -2 2 0 1 -1 2 0 1 1 2 0 1 2 2 0 1                 #points
    -2 2 0 1 -1 2 0 1 1 0 5 1 2 2 0 1
    -2 -2 0 1 -1 -2 0 1 1 -2 0 1 2 -2 0 1
    -2 -2 0 1 -1 -2 0 1 1 -2 0 1 2 -2 0 1

    0 0 0 0 1 1 1 1                                         #uKnots
    0 0 0 0 1 1 1 1                                         #vKnots
)

The control points of a NURB patch are listed in a rectangular order, first in order of increasing v , then in order of increasing u .

Default size

None.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |